@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">
            <input id="id" name="" type="hidden"/>
            <div class="row">
                <div class="col-sm-6 b-r">
                    <!--<#input id="standardCodeOne" name="对照品信息" placehoder = "请输入对照品标识码" type = "text" underline="true"/>-->
                    <#select id="standardCodeOne" name="对照品信息" underline="true"></#select>
                </div>

                <div class="col-sm-6">
                    <#button btnCss="info" name="读取对照品信息" icon="fa-check" clickFun="codeOneFunction()" underline="true"/>
                </div>
            </div>
            <div id = "codeOne">
                <div class="row">
                    <div class="col-sm-6 b-r">
                        <#input id="testCode" name="对照品名称" underline="true"/>
                        <#input id="testId" name="批号" underline="true"/>
                        <#input id="standardLabel" name="标号" underline="true"/>

                    </div>

                    <div class="col-sm-6">
                        <#input id="standardPath" name="存储路径" underline="true"/>
                        <#input id="standardCondition" name="存储条件" underline="true"/>
                        <#input id="testPurpose" name="检验目的" underline="true"/>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6 b-r">
                    <#select id="standardCodeTwo" name="检品信息" underline="true"></#select>
                    <!--<#input id="standardCodeTwo" name="检品信息" placehoder = "请输入检品标识码" type = "text" underline="true"/>-->
                </div>

                <div class="col-sm-6">
                    <#button btnCss="info" name="读取检品信息" icon="fa-check" clickFun="codeTwoFunction()" underline="true"/>
                </div>
            </div>
            <div id = "codeTwo">
                <div class="row">
                    <div class="col-sm-6 b-r">
                        <#input id="testId2" name="批号" underline="true"/>
                        <#input id="standardLabel2" name="标号" underline="true"/>
                        <#input id="testRemarks" name="备注" underline="true"/>
                    </div>

                    <div class="col-sm-6">
                        <#input id="testCode2" name="检品名称" underline="true"/>
                        <#input id="standardPath2" name="存储路径" underline="true"/>
                        <#input id="standardCondition2" name="存储条件" underline="true"/>
                        <!--<#input id="testPurpose2" name="检验目的" underline="true"/>-->
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6 b-r">
                        <!--<#input id="testPretreatmentYn" name="是否预处理" underline="true"/>-->
                    </div>
                    <div class="col-sm-6">
                        <!--<#input id="testPretreatment" name="预处理" underline="true"/>-->
                    </div>
                </div>
            </div>

            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TestRegistInfoDlg.addSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TestRegistInfoDlg.close()"/>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="${ctxPath}/static/modular/standard/testRegist/testRegist_info.js"></script>
<script>
    laydate.render({
        elem: '#testTime'
        ,type: 'datetime'
    });
</script>

<!--隐藏div-->
<style>
    #codeOne{display:none}  /*$('#nav').hide();*/
    #codeTwo{display:none}
</style>
<script>
    function codeOneFunction(){
        var standardCodeOne = document.getElementById("standardCodeOne").value; /*与 data: {useCode:$("#useCode").val()},等同*/
        $.ajax({
            type: "POST",
            contentType:'application/json; charset=utf-8',
            url: "/testRegist/standardCodeOne/"+ standardCodeOne,
            dataType: "json",
            success: function(data){
                $('#codeOne').show();//显示
               $("#testCode").val(data.standardName);
                $("#testId").val(data.standardId);
                $("#standardLabel").val(data.standardLabel);
                $("#standardOrigin").val(data.standardOrigin);
                $("#standardCondition").val(data.standardCondition);
                $("#testPurpose").val(data.standardUse);
                $("#standardPath").val(data.standardPath);

                alert("对照品标识码为"+ standardCodeOne);

            },
            error: function(data){
                $('#codeOne').hide();//不显示
            }
        });
    }
</script>

<script>
    function codeTwoFunction(){
        var standardCodeTwo = document.getElementById("standardCodeTwo").value; /*与 data: {useCode:$("#useCode").val()},等同*/
        $.ajax({
            type: "POST",
            contentType:'application/json; charset=utf-8',
            url: "/testRegist/standardCodeTwo/"+ standardCodeTwo,
            dataType: "json",
            success: function(data){
                $('#codeTwo').show();//显示
                $("#testCode2").val(data.standardName);
                $("#testId2").val(data.standardId);
                $("#standardLabel2").val(data.standardLabel);
                $("#standardOrigin2").val(data.standardOrigin);
                $("#standardCondition2").val(data.standardCondition);
                $("#testPurpose2").val(data.standardUse);
                $("#standardPath2").val(data.standardPath);

                alert("检品标识码为"+ standardCodeTwo);

            },
            error: function(data){
                $('#codeTwo').hide();//不显示
            }
        });
    }
</script>
@}
